import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpPay {
  id!: number;
  title?: string;
  type?: boolean;
  payType?: number;
  wxAppid?: string;
  wxMchId?: string;
  wxKey?: string;
  wxApiclientCert?: unknown;
  wxApiclientKey?: unknown;
  wxFwsAppid?: string;
  wxFwsMchId?: string;
  alipayAppId?: string;
  alipayPublicKey?: unknown;
  alipayAppPrivateKey?: unknown;
  alipayAppPublicCert?: unknown;
  alipayRootcert?: unknown;
  uniacid!: number;
}

export const ImsYzdKpPaySchema = new EntitySchema({
  class: ImsYzdKpPay,
  properties: {
    id: { primary: true, type: 'number' },
    title: { type: 'string', length: 255, nullable: true },
    type: { type: 'boolean', nullable: true, index: 'type' },
    payType: { type: 'number', nullable: true, index: 'pay_type' },
    wxAppid: { type: 'string', length: 255, nullable: true },
    wxMchId: { type: 'string', length: 255, nullable: true },
    wxKey: { type: 'string', length: 255, nullable: true },
    wxApiclientCert: { type: 'unknown', columnType: 'longtext', nullable: true },
    wxApiclientKey: { type: 'unknown', columnType: 'longtext', nullable: true },
    wxFwsAppid: { type: 'string', length: 255, nullable: true },
    wxFwsMchId: { type: 'string', length: 255, nullable: true },
    alipayAppId: { type: 'string', length: 255, nullable: true },
    alipayPublicKey: { type: 'unknown', columnType: 'longtext', nullable: true },
    alipayAppPrivateKey: { type: 'unknown', columnType: 'longtext', nullable: true },
    alipayAppPublicCert: { type: 'unknown', columnType: 'longtext', nullable: true },
    alipayRootcert: { type: 'unknown', columnType: 'longtext', nullable: true },
    uniacid: { type: 'number', index: 'uniacid' },
  },
});
